<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://java.sun.com/jstl/core">
<h:head></h:head>
<h:body>
 <ui:composition template="/templates/Plantilla.xhtml">	
  <ui:define name="content">
   <h:form id="form">
   <p:growl id="growl1" />				
   				
		<h3 style="text-align: center; padding-bottom:35px;"> Gestión de Vehiculos</h3>
		<p:dataTable id="tblVehiculos" var="vehiculo" value="#{vehiculoList.vehiculos}" rowKey="#{vehiculo.vehiculoId}"
		 			paginator="true" rows="10"
					emptyMessage="No se encontró ningun Vehiculo">
		  
			<p:column>
   				<f:facet name="header">
   					<h:commandButton action="#{vehiculoList.nuevoVehiculo()}" 
   					image="#{resource['images:plus-16-ns.png']}"
   					title = "Nuevo Vehiculo">
   					</h:commandButton>
   				</f:facet>
    			<h:commandButton type="submit" action="#{vehiculoList.prepareEdit(vehiculo)}" 
    				image="#{resource['images:pencil-16-ns.png']}"
    				title = "Editar Vehiculo">			    					
   				</h:commandButton>	
   			</p:column>
   			
   			<p:column filterBy="#{vehiculo.patente}">
   				<f:facet name="header">Patente</f:facet>
   				#{vehiculo.patente}
   			</p:column>   		
   			
			<p:column filterBy="#{vehiculo.marca}">
   				<f:facet name="header">Marca</f:facet>
   				#{vehiculo.marca}
   			</p:column>
   			
   			<p:column filterBy="#{vehiculo.modelo}">
   				<f:facet name="header">Modelo</f:facet>
   				#{vehiculo.modelo}
   			</p:column>
   			
   			<p:column filterBy="#{vehiculo.tipo}">
   				<f:facet name="header">Tipo</f:facet>
   				#{vehiculo.tipo}
   			</p:column>   		   			
		</p:dataTable>
		
	</h:form>			
 </ui:define>
</ui:composition>
</h:body>
</html>